<template>
    <div>
        <top-bar></top-bar>
        <left-bar :datas='data'></left-bar>
        <div class="system">
            <home-bar :currentPage='currentPage'></home-bar>
            <div class="system-main">
                <div class="main-position">
                    首页 > 系统设置 > 商户资料
                    <a href="javascript:void(0);"><i class="el-icon-refresh"></i></a>
                </div>
                <div class="main-height"></div>
                <div class="main-mains">
                    <div class="main-top-nav">
                        <ul>
                            <router-link to="/system" @click.native="addPath('/system','系统设置')">
                                <li class="active">商户资料</li>
                            </router-link>
                            <router-link to="/systemSafe" @click.native="addPath('/systemSafe','系统设置')">
                                <li>安全设置</li>
                            </router-link>
                            <router-link to="/systemStockAlert" @click.native="addPath('/systemStockAlert','系统设置')">
                                <li>库存预警设置</li>
                            </router-link>
                            <router-link to="/recommend" @click.native="addPath('/recommend','系统设置')">
                                <li>我要推荐</li>
                            </router-link>
                            <router-link to="/recommends" @click.native="addPath('/recommends','系统设置')">
                                <li>推荐管理</li>
                            </router-link>
                            <router-link to="/about" @click.native="addPath('/about','系统设置')">
                                <li>关于我们</li>
                            </router-link>
                        </ul>
                    </div>
                    <div class="system-con">
                        <div class="system-con-top">
                            <div class="system-con-top-l fl">
                                <div class="fl system-con-top-img">
                                    <img :src=business_img alt="">
                                </div>
                                <div class="fl">
                                    <div class="system-con-top-cor">商检：{{business}}</div>
                                    <div class="system-con-top-bar">注册时间：{{creatTime}}</div>
                                    <div>认证状态：<span>{{status}}</span></div>
                                </div>
                            </div>
                            <div class="system-con-top-r fr">
                                <img :src=status_img alt="">
                            </div>
                        </div>
                        <div class="system-con-local">
                            <div class="clear system-con-border"><span class="fl">归属地</span>
                                <div class="fl system-con-borders"></div>
                            </div>
                            <el-select v-model="province" placeholder="请选择省份" @change=provinces class="system-con-sel">
                                <el-option v-for="item in provinceOptions" :key="item.value" :label="item.label" :value="item.value">
                                </el-option>
                            </el-select>
                            <el-select v-model="city" placeholder="请选择城市">
                                <el-option v-for="item in cityOptions" :key="item.value" :label="item.label" :value="item.value">
                                </el-option>
                            </el-select>
                        </div>
                        <div class="system-con-data">
                            <div class="clear system-con-border"><span class="fl">商家认证资料</span>
                                <div class="fl system-con-borders"></div>
                            </div>
                            <div class="system-con-datas">
                                <div class="system-con-datas-list clear">
                                    <div class="fl system-con-datas-list1">
                                        <div v-if="authentication.show1">
                                            <img src="../images/system-con-datas-a.png" alt=""><br>
                                            <span>已上传</span>
                                        </div>
                                    </div>
                                    <div class="fl system-con-datas-list2">营业执照</div>
                                    <div class="fl system-con-datas-list3">需完成有效年检且所售商品属于经营范围内；超营范围、②未年检、③效期超期：应有正在办理证明；</div>
                                    <div class="fr system-con-datas-list4">
                                        <div class="upload-demo">选择文件</div>
                                        <input type="file" @change="picture(1,$event)">
                                    </div>
                                </div>
                                <div class="system-con-datas-list clear">
                                    <div class="fl system-con-datas-list1">
                                        <div v-if="authentication.show2">
                                            <img src="../images/system-con-datas-a.png" alt=""><br>
                                            <span>已认证</span>
                                        </div>
                                    </div>
                                    <div class="fl system-con-datas-list2">营业执照有效期</div>
                                    <div class="fl system-con-datas-list3">正常营业执照有效期内</div>
                                    <div class="fr system-con-datas-list4">
                                        <el-date-picker v-model="odate" type="date" value-format="yyyy-MM-dd" placeholder="请选择失效日期">
                                        </el-date-picker>
                                    </div>
                                </div>
                                <div class="system-con-datas-list clear">
                                    <div class="fl system-con-datas-list1">
                                        <div v-if="authentication.show3">
                                            <img src="../images/system-con-datas-a.png" alt=""><br>
                                            <span>已上传</span>
                                        </div>
                                    </div>
                                    <div class="fl system-con-datas-list2">税务登记</div>
                                    <div class="fl system-con-datas-list3">国税、地税均可，优先上传盖有国税局印章的税务登记证；</div>
                                    <div class="fr system-con-datas-list4">
                                        <div class="upload-demo">选择文件</div>
                                        <input type="file" @change="picture(2,$event)">
                                    </div>
                                </div>
                                <div class="system-con-datas-list clear">
                                    <div class="fl system-con-datas-list1">
                                        <div v-if="authentication.show4">
                                            <img src="../images/system-con-datas-a.png" alt=""><br>
                                            <span>已上传</span>
                                        </div>
                                    </div>
                                    <div class="fl system-con-datas-list2">组织机构代码证</div>
                                    <div class="fl system-con-datas-list3">组织机构代码证必须要年检，年检要求同营业执照年检要求一致，如果出现当地政策规定不定期（非正常年度）年检的情况，需出具政府发文文件的复印件并加盖供应商公章；</div>
                                    <div class="fr system-con-datas-list4">
                                        <div class="upload-demo">选择文件</div>
                                        <input type="file" @change="picture(3,$event)">
                                    </div>
                                </div>
                                <div class="system-con-datas-list clear">
                                    <div class="fl system-con-datas-list1">
                                        <div v-if="authentication.show5">
                                            <img src="../images/system-con-datas-a.png" alt=""><br>
                                            <span>已上传</span>
                                        </div>
                                    </div>
                                    <div class="fl system-con-datas-list2">营业执照年检情况</div>
                                    <div class="fl system-con-datas-list3">上一年度企业年度报告公示情况，提供年检公示表；登录<a href="http://hn.gsxt.gov.cn/notice/" target="_blank">http://hn.gsxt.gov.cn/notice/</a>，选择所在省份，输入企业名称或信用代码查询，点击企业名称，查看年度报告（上年度的）页面，然后打印；如果是个体工商户的，点击打开个体工商户公示信息页面后直接打印；</div>
                                    <div class="fr system-con-datas-list4">
                                        <div class="upload-demo">选择文件</div>
                                        <input type="file" @change="picture(4,$event)">
                                    </div>
                                </div>
                                <div class="system-con-datas-list clear">
                                    <div class="fl system-con-datas-list1">
                                        <div v-if="authentication.show6">
                                            <img src="../images/system-con-datas-a.png" alt=""><br>
                                            <span>已上传</span>
                                        </div>
                                    </div>
                                    <div class="fl system-con-datas-list2">一般纳税人资质证明</div>
                                    <div class="fl system-con-datas-list3">扫描件一般纳税人证书如果纳税人在辅导期的，需出具“辅导期商函”；</div>
                                    <div class="fr system-con-datas-list4">
                                        <div class="upload-demo">选择文件</div>
                                        <input type="file" @change="picture(5,$event)">
                                    </div>
                                </div>
                                <div class="system-con-datas-list clear">
                                    <div class="fl system-con-datas-list1">
                                        <div v-if="authentication.show7">
                                            <img src="../images/system-con-datas-a.png" alt=""><br>
                                            <span>已上传</span>
                                        </div>
                                    </div>
                                    <div class="fl system-con-datas-list2">开户许可证复印件</div>
                                    <div class="fl system-con-datas-list3">开户户名、开户银行及账号。</div>
                                    <div class="fr system-con-datas-list4">
                                        <div class="upload-demo">选择文件</div>
                                        <input type="file" @change="picture(6,$event)">
                                    </div>
                                </div>
                                <div class="system-con-datas-list clear">
                                    <div class="fl system-con-datas-list1">
                                        <div v-if="authentication.show8">
                                            <img src="../images/system-con-datas-a.png" alt=""><br>
                                            <span>已上传</span>
                                        </div>
                                    </div>
                                    <div class="fl system-con-datas-list2">法人代表身份证复印件</div>
                                    <div class="fl system-con-datas-list3">正反面扫描件。</div>
                                    <div class="fr system-con-datas-list4">
                                        <div class="upload-demo">选择文件</div>
                                        <input type="file" @change="picture(7,$event)">
                                    </div>
                                </div>
                                <div class="system-con-datas-list clear">
                                    <div class="fl system-con-datas-list1">
                                        <div v-if="authentication.show9">
                                            <img src="../images/system-con-datas-a.png" alt=""><br>
                                            <span>已上传</span>
                                        </div>
                                    </div>
                                    <div class="fl system-con-datas-list2">企业印章样票复印件</div>
                                    <div class="fl system-con-datas-list3">A4纸张加盖企业鲜章：公章、合同专用章、发票专用章、财务专用章、法人章、销售专用章、发货专用章、质量部印章等等；</div>
                                    <div class="fr system-con-datas-list4">
                                        <div class="upload-demo">选择文件</div>
                                        <input type="file" @change="picture(8,$event)">
                                    </div>
                                </div>
                                <div class="system-con-datas-list clear">
                                    <div class="fl system-con-datas-list1">
                                        <div v-if="authentication.show10">
                                            <img src="../images/system-con-datas-a.png" alt=""><br>
                                            <span>已上传</span>
                                        </div>
                                    </div>
                                    <div class="fl system-con-datas-list2">合格供货方档案表</div>
                                    <div class="fl system-con-datas-list3">要求填写后加盖公章</div>
                                    <div class="fr system-con-datas-list4">
                                        <div class="upload-demo">选择文件</div>
                                        <input type="file" @change="picture(9,$event)">
                                    </div>
                                </div>
                                <div class="system-con-datas-list clear">
                                    <div class="fl system-con-datas-list1">
                                        <div v-if="authentication.show11">
                                            <img src="../images/system-con-datas-a.png" alt=""><br>
                                            <span>已上传</span>
                                        </div>
                                    </div>
                                    <div class="fl system-con-datas-list2">供货单位质量保证情况调查表</div>
                                    <div class="fl system-con-datas-list3">要求填写后加盖公章</div>
                                    <div class="fr system-con-datas-list4">
                                        <div class="upload-demo">选择文件</div>
                                        <input type="file" @change="picture(10,$event)">
                                    </div>
                                </div>
                                <div class="system-con-datas-list clear">
                                    <div class="fl system-con-datas-list1">
                                        <div v-if="authentication.show12">
                                            <img src="../images/system-con-datas-a.png" alt=""><br>
                                            <span>已上传</span>
                                        </div>
                                    </div>
                                    <div class="fl system-con-datas-list2">随货同行联（出库单样本表）</div>
                                    <div class="fl system-con-datas-list3">要求填写后加盖公章</div>
                                    <div class="fr system-con-datas-list4">
                                        <div class="upload-demo">选择文件</div>
                                        <input type="file" @change="picture(11,$event)">
                                    </div>
                                </div>
                                <div class="system-con-datas-list clear">
                                    <div class="fl system-con-datas-list1">
                                        <div v-if="authentication.show13">
                                            <img src="../images/system-con-datas-a.png" alt=""><br>
                                            <span>已上传</span>
                                        </div>
                                    </div>
                                    <div class="fl system-con-datas-list2">药品经营质量保证协议</div>
                                    <div class="fl system-con-datas-list3">要求填写后加盖公章</div>
                                    <div class="fr system-con-datas-list4">
                                        <div class="upload-demo">选择文件</div>
                                        <input type="file" @change="picture(12,$event)">
                                    </div>
                                </div>
                                <div class="system-con-datas-list clear">
                                    <div class="fl system-con-datas-list1">
                                        <div v-if="authentication.show14">
                                            <img src="../images/system-con-datas-a.png" alt=""><br>
                                            <span>已上传</span>
                                        </div>
                                    </div>
                                    <div class="fl system-con-datas-list2">开票资料</div>
                                    <div class="fl system-con-datas-list3">开票资料1份（帐号、开户行、组织机构代码证、税务登记证）加盖公司鲜章上传</div>
                                    <div class="fr system-con-datas-list4">
                                        <div class="upload-demo">选择文件</div>
                                        <input type="file" @change="picture(13,$event)">
                                    </div>
                                </div>
                                <div class="system-con-datas-list clear">
                                    <div class="fl system-con-datas-list1">
                                        <div v-if="authentication.show15">
                                            <img src="../images/system-con-datas-a.png" alt=""><br>
                                            <span>已上传</span>
                                        </div>
                                    </div>
                                    <div class="fl system-con-datas-list2">销售授权委托书</div>
                                    <div class="fl system-con-datas-list3">附销售人员身份证、上岗证复印件、加盖法人代表签章及公司公章上岗证（要求药监局发的购销证），如果是药学相关专业可不提供上岗证委托书具体内容应该至少包括：销售人员名字、身份证号码、委托区域、时间、委托品种（从经营公司引进的写明我公司经营的所有产品；从生产企业引进的写明品种或附表）、盖有供货单位公章、法人章或签字</div>
                                    <div class="fr system-con-datas-list4">
                                        <div class="upload-demo">选择文件</div>
                                        <input type="file" @change="picture(14,$event)">
                                    </div>
                                </div>
                                <div class="system-con-datas-list clear">
                                    <div class="fl system-con-datas-list1">
                                        <div v-if="authentication.show16">
                                            <img src="../images/system-con-datas-a.png" alt=""><br>
                                            <span>已上传</span>
                                        </div>
                                    </div>
                                    <div class="fl system-con-datas-list2">商品条码证复印件</div>
                                    <div class="fl system-con-datas-list3">加盖企业鲜章</div>
                                    <div class="fr system-con-datas-list4">
                                        <div class="upload-demo">选择文件</div>
                                        <input type="file" @change="picture(15,$event)">
                                    </div>
                                </div>
                                <div class="system-con-datas-list system-con-datas-lists clear">
                                    <div class="fl system-con-datas-list1">
                                        <div v-if="authentication.show17">
                                            <img src="../images/system-con-datas-a.png" alt=""><br>
                                            <span>已上传</span>
                                        </div>
                                    </div>
                                    <div class="fl system-con-datas-list2">商标注册证复印件</div>
                                    <div class="fl system-con-datas-list3">新品需提交，加盖供应商公章</div>
                                    <div class="fr system-con-datas-list4">
                                        <div class="upload-demo">选择文件</div>
                                        <input type="file" @change="picture(16,$event)">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="system-con-bto">
                            <div class="clear system-con-border"><span class="fl">经营范围</span>
                                <div class="fl system-con-borders"></div>
                            </div>
                            <div class="system-con-bto-con">
                                <div class="system-con-bto-title">
                                    药品
                                </div>
                                <div class="system-con-bto-cons">
                                    <div class="system-con-bto-titles">
                                        基本
                                    </div>
                                    <div class="system-con-bto-sel">
                                        <div>
                                            <div class="fl system-scopeList" v-for="(item,index) in checkList1" :key="index">
                                                <input type="checkbox" :value=item.id class="datalists">
                                                <span>{{item.name}}</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="system-con-bto-bto">
                                        <div class="system-con-bto-bto-t">
                                            <span>资质提交材料要求：</span> 1、《药品生产许可证》/《药品经营许可证》复印件； 2、GSP/GMP证书复印件；
                                        </div>
                                        <div class="system-con-bto-bto-b clear">
                                            <span class="fl">《药品生产许可证》  ——</span>
                                            <div class="upload-demos">
                                                <span>选择文件</span>
                                                <input type="file" @change="picture(17,$event)">
                                            </div>
                                            <span class="fl">药品经营许可证  ——</span>
                                            <div class="upload-demos">
                                                <span>选择文件</span>
                                                <input type="file" @change="picture(18,$event)">
                                            </div>
                                            <span class="fl">GPS证书  ——</span>
                                            <div class="upload-demos">
                                                <span>选择文件</span>
                                                <input type="file" @change="picture(19,$event)">
                                            </div>
                                            <span class="fl">GMP证书  ——</span>
                                            <div class="upload-demos">
                                                <span>选择文件</span>
                                                <input type="file" @change="picture(20,$event)">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="system-con-bto-con">
                                <div class="system-con-bto-title">
                                    器械
                                </div>
                                <div class="system-con-bto-cons">
                                    <div class="system-con-bto-titles">
                                        基本
                                    </div>
                                    <div class="system-con-bto-sel">
                                        <div>
                                            <div class="fl system-scopeList" v-for="(item,index) in checkList2" :key="index">
                                                <input type="checkbox" :value=item.id class="datalists">
                                                <span>{{item.name}}</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="system-con-bto-bto">
                                        <div class="system-con-bto-bto-t">
                                            <span>资质提交材料要求：</span> 1、《医疗器械经营许可证》/《医疗器械生产许可证》复印件；2、经营二类的器械提供备案表复印件；3、生产第一类医疗器械的提供生产备案凭证复印件；
                                        </div>
                                        <div class="system-con-bto-bto-b clear">
                                            <span class="fl">《医疗器械经营许可证》  ——</span>
                                            <div class="upload-demos">
                                                <span>选择文件</span>
                                                <input type="file" @change="picture(21,$event)">
                                            </div>
                                            <span class="fl">《医疗器械生产许可证》  ——</span>
                                            <div class="upload-demos">
                                                <span>选择文件</span>
                                                <input type="file" @change="picture(22,$event)">
                                            </div>
                                            <span class="fl">二类器械备案表复印件  ——</span>
                                            <div class="upload-demos">
                                                <span>选择文件</span>
                                                <input type="file" @change="picture(23,$event)">
                                            </div>
                                            <span class="fl">生产备案凭证复印件   ——</span>
                                            <div class="upload-demos">
                                                <span>选择文件</span>
                                                <input type="file" @change="picture(24,$event)">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="system-con-bto-con">
                                <div class="system-con-bto-title">
                                    保健食品
                                </div>
                                <div class="system-con-bto-cons">
                                    <div class="system-con-bto-titles">
                                        基本
                                    </div>
                                    <div class="system-con-bto-sel">
                                        <div>
                                            <div class="fl system-scopeList" v-for="(item,index) in checkList3" :key="index">
                                                <input type="checkbox" :value=item.id class="datalists">
                                                <span>{{item.name}}</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="system-con-bto-bto">
                                        <div class="system-con-bto-bto-t">
                                            <span>资质提交材料要求：</span> 1、《食品生产许可证》/《食品经营许可证》/《食品流通许可证》复印件；2、《食品卫生许可证》复印件;
                                        </div>
                                        <div class="system-con-bto-bto-b clear">
                                            <span class="fl">《食品生产许可证》  ——</span>
                                            <div class="upload-demos">
                                                <span>选择文件</span>
                                                <input type="file" @change="picture(25,$event)">
                                            </div>
                                            <span class="fl">《食品经营许可证》  ——</span>
                                            <div class="upload-demos">
                                                <span>选择文件</span>
                                                <input type="file" @change="picture(26,$event)">
                                            </div>
                                            <span class="fl">《食品流通许可证》  ——</span>
                                            <div class="upload-demos">
                                                <span>选择文件</span>
                                                <input type="file" @change="picture(27,$event)">
                                            </div>
                                            <span class="fl">《食品卫生许可证》   ——</span>
                                            <div class="upload-demos">
                                                <span>选择文件</span>
                                                <input type="file" @change="picture(28,$event)">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="system-con-bto-con">
                                <div class="system-con-bto-title">
                                    化妆品
                                </div>
                                <div class="system-con-bto-cons">
                                    <div class="system-con-bto-titles">
                                        基本
                                    </div>
                                    <div class="system-con-bto-sel">
                                        <div>
                                            <div class="fl system-scopeList" v-for="(item,index) in checkList4" :key="index">
                                                <input type="checkbox" :value=item.id class="datalists">
                                                <span>{{item.name}}</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="system-con-bto-bto">
                                        <div class="system-con-bto-bto-t">
                                            <span>资质提交材料要求：</span> 1、《化妆品生产企业卫生许可证》复印件；2、《全国工业产品生产许可证》复印件；
                                        </div>
                                        <div class="system-con-bto-bto-b clear">
                                            <span class="fl">《化妆品生产企业卫生许可证》 ——</span>
                                            <div class="upload-demos">
                                                <span>选择文件</span>
                                                <input type="file" @change="picture(29,$event)">
                                            </div>
                                            <span class="fl">《全国工业产品生产许可证》  ——</span>
                                            <div class="upload-demos">
                                                <span>选择文件</span>
                                                <input type="file" @change="picture(30,$event)">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="system-con-bto-con">
                                <div class="system-con-bto-title">
                                    消字号产品
                                </div>
                                <div class="system-con-bto-cons">
                                    <div class="system-con-bto-titles">
                                        基本
                                    </div>
                                    <div class="system-con-bto-sel">
                                        <div>
                                            <div class="fl system-scopeList" v-for="(item,index) in checkList5" :key="index">
                                                <input type="checkbox" :value=item.id class="datalists">
                                                <span>{{item.name}}</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="system-con-bto-bto">
                                        <div class="system-con-bto-bto-t">
                                            <span>资质提交材料要求：</span> 1、《消毒用品生产企业卫生许可证》复印件;
                                        </div>
                                        <div class="system-con-bto-bto-b clear">
                                            <span class="fl">《消毒用品生产企业卫生许可证》  ——</span>
                                            <div class="upload-demos">
                                                <span>选择文件</span>
                                                <input type="file" @change="picture(31,$event)">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="system-con-bto-con">
                                <div class="system-con-bto-title">
                                    其他商品
                                </div>
                                <div class="system-con-bto-cons">
                                    <div class="system-con-bto-titles">
                                        基本
                                    </div>
                                    <div class="system-con-bto-sel">
                                        <div>
                                            <div class="fl system-scopeList" v-for="(item,index) in checkList6" :key="index">
                                                <input type="checkbox" :value=item.id class="datalists">
                                                <span>{{item.name}}</span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="system-con-bto-btn">
                            <div class="clear system-con-bto-btns">
                                <div class="fl system-con-bto-btns1" @click="confirm(1)">立即提交认证</div>
                                <div class="fl system-con-bto-btns1 system-con-bto-btns-mar">重新提交</div>
                                <div class="fl system-con-bto-btns2" @click="confirm(2)">保存暂不提交</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import topBar from "../public/top";
import leftBar from "../public/left";
import homeBar from "../public/homebar";
export default {
  components: {
    leftBar,
    topBar,
    homeBar
  },
  data() {
    return {
      data: "/system",
      currentPage: {
        path: "/system",
        name: "系统设置"
      },
      checkList1: [],
      checkList2: [],
      checkList3: [],
      checkList4: [],
      checkList5: [],
      checkList6: [],
      id: "",
      value: "",
      odate: "",
      business: "",
      creatTime: "",
      business_img: "",
      status: "", //认证状态
      status_img: "",
      province: "",
      province_id: "",
      provinceOptions: [],
      city: "",
      city_id: "",
      cityOptions: [],
      authentication: {
        show1: false,
        show2: false,
        show3: false,
        show4: false,
        show5: false,
        show6: false,
        show7: false,
        show8: false,
        show9: false,
        show10: false,
        show11: false,
        show12: false,
        show13: false,
        show14: false,
        show15: false,
        show16: false,
        show17: false
      },
      img_url: [],
      img_urls: [], //去重后的文件上传地址
      scopeList: []
    };
  },
  methods: {
    addPath(n1, n2) {
      //点击切换home-bar
      var obj = {};
      obj.n1 = n1;
      obj.n2 = n2;
      this.$store.commit("addPath", obj);
    },
    information() {
      //获取商户信息
      let _this = this;
      let ourls =
        this.urls +
        "/who/user/refreshToken/" +
        localStorage.getItem("uid") +
        "/" +
        localStorage.getItem("token");
      checkTime(
        new Date().getTime() / 1000,
        ourls,
        localStorage.getItem("reToken")
      );
      _this
        .$http({
          url:
            _this.urls +
            "/who/system/authDetail/" +
            localStorage.getItem("uid") +
            "/" +
            localStorage.getItem("token"),
          method: "post",
          data: {}
        })
        .then(function(res) {
          let data = res.data;
          console.log(data);
          if (data.code == "1") {
            _this.business = data.data.shop_name;
            _this.creatTime = data.data.create_time;
            _this.business_img = data.data.license;
            _this.province = data.data.province_name;
            _this.city = data.data.city_name;
            _this.province_id = data.data.province_id;
            _this.city_id = data.data.city_id;
            _this.id = data.data.id;
            let data_img = data.data.auth_image_list;
            for (var i = 0; i < data_img.length; i++) {
              if (data_img[i].type == 1) {
                _this.authentication.show1 = true;
              } else if (data_img[i].type == 2) {
                _this.authentication.show3 = true;
              } else if (data_img[i].type == 3) {
                _this.authentication.show4 = true;
              } else if (data_img[i].type == 4) {
                _this.authentication.show5 = true;
              } else if (data_img[i].type == 5) {
                _this.authentication.show6 = true;
              } else if (data_img[i].type == 6) {
                _this.authentication.show7 = true;
              } else if (data_img[i].type == 7) {
                _this.authentication.show8 = true;
              } else if (data_img[i].type == 8) {
                _this.authentication.show9 = true;
              } else if (data_img[i].type == 9) {
                _this.authentication.show10 = true;
              } else if (data_img[i].type == 10) {
                _this.authentication.show11 = true;
              } else if (data_img[i].type == 11) {
                _this.authentication.show12 = true;
              } else if (data_img[i].type == 12) {
                _this.authentication.show13 = true;
              } else if (data_img[i].type == 13) {
                _this.authentication.show14 = true;
              } else if (data_img[i].type == 14) {
                _this.authentication.show15 = true;
              } else if (data_img[i].type == 15) {
                _this.authentication.show16 = true;
              } else if (data_img[i].type == 16) {
                _this.authentication.show17 = true;
              }
            }
            if (data.data.auth_status == 0) {
              _this.status = "未认证";
              _this.status_img = "/static/images/system1.png";
            } else if (data.data.auth_status == 1) {
              _this.status = "已认证";
              _this.status_img = "/static/images/system2.png";
            } else {
              _this.status = "审核中";
              _this.status_img = "/static/images/system3.png";
            }
            _this.getCity(_this.province_id);
          }else{
              invalid(data.msg);
          }
        })
        .catch(function(error) {
          console.log(error);
        });
    },
    getLocation() {
      // 获取归属地
      let _this = this;
      let ourls =
        this.urls +
        "/who/user/refreshToken/" +
        localStorage.getItem("uid") +
        "/" +
        localStorage.getItem("token");
      checkTime(
        new Date().getTime() / 1000,
        ourls,
        localStorage.getItem("reToken")
      );
      _this
        .$http({
          url:
            _this.urls +
            "/who/system/getLocation/" +
            localStorage.getItem("uid") +
            "/" +
            localStorage.getItem("token"),
          method: "post",
          data: {}
        })
        .then(function(res) {
          let data = res.data;
          if (data.code == "1") {
            for (let i = 0; i < data.data.length; i++) {
              let arrStr = {
                value: data.data[i].province_id,
                label: data.data[i].name
              };
              _this.provinceOptions.push(arrStr);
            }
          }else{
              invalid(data.msg);
          }
        })
        .catch(function(error) {
          console.log(error);
        });
    },
    getCity(id) {
      let _this = this;
      let ourls =
        this.urls +
        "/who/user/refreshToken/" +
        localStorage.getItem("uid") +
        "/" +
        localStorage.getItem("token");
      checkTime(
        new Date().getTime() / 1000,
        ourls,
        localStorage.getItem("reToken")
      );
      _this
        .$http({
          url:
            _this.urls +
            "/who/system/getLocation/" +
            localStorage.getItem("uid") +
            "/" +
            localStorage.getItem("token"),
          method: "post",
          data: {
            province_id: id
          }
        })
        .then(function(res) {
          let data = res.data;
          if (data.code == "1") {
            for (let i = 0; i < data.data.length; i++) {
              let arrStr = {
                value: data.data[i].city_id,
                label: data.data[i].name
              };
              _this.cityOptions.push(arrStr);
            }
          }else{
              invalid(data.msg);
          }
        })
        .catch(function(error) {
          console.log(error);
        });
    },
    provinces(val) {
      this.cityOptions = [];
      this.city = "";
      this.getCity(val);
    },
    picture(nums, event) {
      let _this = this;
      let demos = event.currentTarget.files[0];
      let reader = new FileReader();
      let imgUrlBase64;
      if (demos) {
        imgUrlBase64 = reader.readAsDataURL(demos);
        reader.onload = function(e) {
          _this.upload(nums, reader.result);
        };
      }
    },
    operation() {
      //经营范围
      let _this = this;
      let ourls =
        this.urls +
        "/who/user/refreshToken/" +
        localStorage.getItem("uid") +
        "/" +
        localStorage.getItem("token");
      checkTime(
        new Date().getTime() / 1000,
        ourls,
        localStorage.getItem("reToken")
      );
      _this
        .$http({
          url:
            _this.urls +
            "/who/system/getScopeList/" +
            localStorage.getItem("uid") +
            "/" +
            localStorage.getItem("token"),
          method: "post",
          data: {}
        })
        .then(function(res) {
          let data = res.data;
          if (data.code == "1") {
            for (let i = 0; i < data.data.length; i++) {
              if (data.data[i].type == 1) {
                _this.checkList1.push({
                  name: data.data[i].name,
                  id: data.data[i].id
                });
              } else if (data.data[i].type == 2) {
                _this.checkList2.push({
                  name: data.data[i].name,
                  id: data.data[i].id
                });
              } else if (data.data[i].type == 3) {
                _this.checkList3.push({
                  name: data.data[i].name,
                  id: data.data[i].id
                });
              } else if (data.data[i].type == 4) {
                _this.checkList4.push({
                  name: data.data[i].name,
                  id: data.data[i].id
                });
              } else if (data.data[i].type == 5) {
                _this.checkList5.push({
                  name: data.data[i].name,
                  id: data.data[i].id
                });
              } else {
                _this.checkList6.push({
                  name: data.data[i].name,
                  id: data.data[i].id
                });
              }
            }
          }else{
              invalid(data.msg);
          }
        })
        .catch(function(error) {
          console.log(error);
        });
    },
    upload(num, imgs) {
      let _this = this;
      let ourls =
        this.urls +
        "/who/user/refreshToken/" +
        localStorage.getItem("uid") +
        "/" +
        localStorage.getItem("token");
      checkTime(
        new Date().getTime() / 1000,
        ourls,
        localStorage.getItem("reToken")
      );
      _this
        .$http({
          url:
            _this.urls +
            "/who/system/uploadAuthImage/" +
            localStorage.getItem("uid") +
            "/" +
            localStorage.getItem("token"),
          method: "post",
          data: {
            type: num,
            image: imgs
          }
        })
        .then(function(res) {
          let data = res.data;
          if (data.code == "1") {
            _this.$message({
              message: "上传成功",
              type: "success"
            });
            if (num == 1) {
              _this.authentication.show1 = true;
            } else if (num == 2) {
              _this.authentication.show3 = true;
            } else if (num == 3) {
              _this.authentication.show4 = true;
            } else if (num == 4) {
              _this.authentication.show5 = true;
            } else if (num == 5) {
              _this.authentication.show6 = true;
            } else if (num == 6) {
              _this.authentication.show7 = true;
            } else if (num == 8) {
              _this.authentication.show8 = true;
            } else if (num == 9) {
              _this.authentication.show10 = true;
            } else if (num == 10) {
              _this.authentication.show11 = true;
            } else if (num == 11) {
              _this.authentication.show12 = true;
            } else if (num == 12) {
              _this.authentication.show13 = true;
            } else if (num == 13) {
              _this.authentication.show14 = true;
            } else if (num == 14) {
              _this.authentication.show15 = true;
            } else if (num == 15) {
              _this.authentication.show16 = true;
            } else if (num == 16) {
              _this.authentication.show17 = true;
            }
            let img_data = {
              image_id: data.data.image.id,
              type: num
            };
            _this.img_url.unshift(img_data);
            let array = _this.img_url;
            let result = [array[0]];
            for (var i = 1; i < array.length; i++) {
              var item = array[i];
              var repeat = false;
              for (var j = 0; j < result.length; j++) {
                if (item.type == result[j].type) {
                  repeat = true;
                  break;
                }
              }
              if (!repeat) {
                result.push(item);
              }
            }
            _this.img_urls = result;
          } else {
              invalid(data.msg);
            _this.$message.error(data.msg);
          }
        })
        .catch(function(error) {
          console.log(error);
        });
    },
    confirm(e) {
      //  1提交审核 2保存不提交
      let _this = this;
      let ourls =
        this.urls +
        "/who/user/refreshToken/" +
        localStorage.getItem("uid") +
        "/" +
        localStorage.getItem("token");
      checkTime(
        new Date().getTime() / 1000,
        ourls,
        localStorage.getItem("reToken")
      );
      if (_this.odate == "") {
        _this.$message.error("请选择失效日期");
        return false;
      }
      let obj = document.getElementsByClassName("datalists");
      let ids = [];
      for (let k in obj) {
        if (obj[k].checked) {
          ids.push(obj[k].value);
        }
      }
      ids.join(",");
      _this.img_urls = JSON.stringify(_this.img_urls);
      _this
        .$http({
          url:
            _this.urls +
            "/who/system/authSubmit/" +
            localStorage.getItem("uid") +
            "/" +
            localStorage.getItem("token"),
          method: "post",
          data: {
            province_id: _this.province_id,
            city_id: _this.city_id,
            expire_date: _this.odate,
            scope: ids,
            status: e,
            auth_id: _this.id,
            auth_image_list: _this.img_urls,
            license_image: ""
          },
          transformRequest: [
            function(data) {
              let ret = "";
              for (let it in data) {
                ret +=
                  encodeURIComponent(it) +
                  "=" +
                  encodeURIComponent(data[it]) +
                  "&";
              }
              return ret;
            }
          ],
          headers: {
            "Content-Type": "application/x-www-form-urlencoded"
          }
        })
        .then(function(res) {
          let data = res.data;
          console.log(data);
          if (data.code == "1") {
            _this.$message({
              message: "上传成功",
              type: "success"
            });
            _this.img_urls = [];
          } else {
              invalid(data.msg);
            _this.$message.error(data.msg);
          }
        })
        .catch(function(error) {
          console.log(error);
        });
    }
  },
  activated() {
    this.information();
    this.getLocation();
    this.operation();
  }
};
</script>

<style lang="less" scoped>
@import "system.less";
</style>

